package com.zccx.eth.util;

/**
 * @Description: 操作结果处理
 * @author lilong@tsinghuabigdata.com
 * @date 2014-3-13下午5:31:38 version 1.0
 */
public class Result {
	/**
	 * 处理状态
	 */
	private boolean success = true;
	/**
	 * 处理消息
	 */
	private Object message;

	public Result() {
		super();
	}

	/**
	 * 如只传消息参数则success默认为true
	 * 
	 * @param message
	 */
	public Result(Object message) {
		this(true, message);
	}

	public Result(boolean success, Object message) {
		this.success = success;
		this.message = message;
	}

	public static Result createBySuccessMessage(Object message){
		return new Result(true,message);
	}
	public static Result createByErrorMessage(Object message){
		return new Result(false,message);
	}
	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}


	public void setMessage(String message) {
		this.message = message;
	}
	public Object getMessage() {
		return message;
	}


}
